package com.activemq.config;


import org.apache.activemq.command.ActiveMQQueue;
import org.apache.activemq.command.ActiveMQTempTopic;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.jms.Queue;
import javax.jms.Topic;

/**
 * 配置文件
 */
@Configuration
public class JmsConfig {
    @Value("${tx.jms.queueName}")
    private String queueName;
    @Value("${tx.jms.topicName}")
    private String topicName;

    @Bean
    public Queue getTxQueue() {
        return new ActiveMQQueue(queueName);
    }

    @Bean
    public Topic getTxTopic() {
        return new ActiveMQTempTopic(topicName);
    }
}
